package net.lahuobao.mall.entity.admin;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * @Title: Entity
 * @Description: ETC用户关系表
 * @author zhangdaihao
 * @date 2016-12-06 14:38:54
 * @version V1.0
 *
 */
@Entity
@Table(name = "mall_etc_user", schema = "lahuobao")
@DynamicUpdate(true)
@DynamicInsert(true)
@SuppressWarnings("serial")
public class MallEtcUserEntity implements java.io.Serializable {
    /**id*/
    private java.lang.Integer id;
    /**用户id*/
    private java.lang.Integer userid;
    /**用户名*/
    private java.lang.String userName;
    /**车牌号*/
    private java.lang.String carno;
    /**卡号*/
    private java.lang.String cardno;
    /**0:未激活，1:已激活*/
    private java.lang.Integer state;

    private UserEntity lhbUser;
    /**
     *方法: 取得java.lang.Integer
     *@return: java.lang.Integer  id
     */

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name ="ID",nullable=false,precision=10,scale=0)
    public java.lang.Integer getId(){
        return this.id;
    }

    /**
     *方法: 设置java.lang.Integer
     *@param: java.lang.Integer  id
     */
    public void setId(java.lang.Integer id){
        this.id = id;
    }
    /**
     *方法: 取得java.lang.Integer
     *@return: java.lang.Integer  用户id
     */
    @Column(name ="USERID",nullable=false,precision=10,scale=0)
    public java.lang.Integer getUserid(){
        return this.userid;
    }

    /**
     *方法: 设置java.lang.Integer
     *@param: java.lang.Integer  用户id
     */
    public void setUserid(java.lang.Integer userid){
        this.userid = userid;
    }
    /**
     *方法: 取得java.lang.String
     *@return: java.lang.String  车牌号
     */
    @Column(name ="CARNO",nullable=false,length=20)
    public java.lang.String getCarno(){
        return this.carno;
    }

    /**
     *方法: 设置java.lang.String
     *@param: java.lang.String  车牌号
     */
    public void setCarno(java.lang.String carno){
        this.carno = carno;
    }
    /**
     *方法: 取得java.lang.String
     *@return: java.lang.String  卡号
     */
    @Column(name ="CARDNO",nullable=false,length=50)
    public java.lang.String getCardno(){
        return this.cardno;
    }

    /**
     *方法: 设置java.lang.String
     *@param: java.lang.String  卡号
     */
    public void setCardno(java.lang.String cardno){
        this.cardno = cardno;
    }
    /**
     *方法: 取得java.lang.Integer
     *@return: java.lang.Integer  0:未激活，1:已激活
     */
    @Column(name ="STATE",nullable=false,precision=10,scale=0)
    public java.lang.Integer getState(){
        return this.state;
    }

    /**
     *方法: 设置java.lang.Integer
     *@param: java.lang.Integer  0:未激活，1:已激活
     */
    public void setState(java.lang.Integer state){
        this.state = state;
    }

    @OneToOne
    @JoinColumn(name = "userId",insertable = false,updatable = false)
    public UserEntity getLhbUser() {
        return lhbUser;
    }

    public void setLhbUser(UserEntity lhbUser) {
        this.lhbUser = lhbUser;
    }

    @Transient
    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }
}
